﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bootstrap.Definition.Enums;
using Bootstrap.Template.TemplateInnerItem;

namespace Bootstrap.Template.Button
{
    public partial class BootstrapButtonTemplate
    {
        #region Properties

        public BootstrapButtonTemplateItem ItemTemplate { get; set; }

        #endregion

        #region Methods

        private string GetCssClass()
        {
            string result = string.Empty;

            switch (this.ItemTemplate.Type)
            {
                case TypeEnum.Default:
                    result += " btn-default ";
                    break;
                case TypeEnum.Primary:
                    result += " btn-primary ";
                    break;
                case TypeEnum.Success:
                    result += " btn-success ";
                    break;
                case TypeEnum.Info:
                    result += " btn-info ";
                    break;
                case TypeEnum.Warning:
                    result += " btn-warning ";
                    break;
                case TypeEnum.Danger:
                    result += " btn-danger ";
                    break;
                default:
                    break;
            }

            switch (this.ItemTemplate.Size)
            {
                case SizeEnum.Small:
                    result += " btn-sm ";
                    break;
                case SizeEnum.Large:
                    result += " btn-lg ";
                    break;
                case SizeEnum.XSmall:
                    result += " btn-xs ";
                    break;
            }

            if (this.ItemTemplate.Active)
                result += " active  ";

            if (this.ItemTemplate.Disable)
                result += " disabled ";


            return result;
        }

        #endregion

    }
}
